package com.webchat.chat.core.shiro;

import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * Created by Owner on 2018/6/27.
 */
public class UserToken extends UsernamePasswordToken {

    private String browserVersion; // 浏览器版本
    private String loginIp;        // 登录IP
    private String sessionId;      // 当前SESSIONID
    private String loginPassword;  // 登录密码
    private String domain; // 域名

    public UserToken() {
        super();
    }

    public UserToken(String userName, String password,
                     boolean rememberMe, String browserVersion, String loginIp,
                     String sessionId, String domain) {
        super(userName, password, rememberMe);
        this.loginPassword = password;
        this.browserVersion = browserVersion;
        this.loginIp = loginIp;
        this.sessionId = sessionId;
        this.domain = domain;
    }

    @Override
    public void clear() {
        super.clear();
        this.browserVersion = null;
        this.loginIp = null;
        this.loginPassword = null;
    }

    public String getBrowserVersion() {
        return browserVersion;
    }

    public void setBrowserVersion(String browserVersion) {
        this.browserVersion = browserVersion;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getLoginPassword() {
        return loginPassword;
    }

    public void setLoginPassword(String loginPassword) {
        this.loginPassword = loginPassword;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }
}
